package com.photoeditor.demo.ui.widget.autopoll;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.common.base.utils.DeviceUtils;

/**
 * Created by Lee on 2018/9/17.
 */

public class BannerItemDivider extends RecyclerView.ItemDecoration {

    private static final int sLeft = DeviceUtils.dip2px(5);

    private int mOffset;

    public BannerItemDivider(int offset) {
        this.mOffset = offset;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        if (parent.getChildLayoutPosition(view) == 0) {
            outRect.left = sLeft;
        } /*else {
            outRect.left = mOffset;
        }*/
    }
}
